/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.taglib;

import com.minierp.helper.PageHelper;
import com.minierp.model.SimpleObjectInterface;
import java.util.List;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class ShowSimpleObjectName extends TagSupport {
	private static final long serialVersionUID = 1L;
	private List list;
	private long objectId = 0L;
	private boolean escapeXml = true;

	public int doStartTag() throws JspException {
		try {
			String e = "";
			if (this.list != null && this.objectId != 0L) {
				for (int out = 0; out < this.list.size(); ++out) {
					SimpleObjectInterface soi = (SimpleObjectInterface) this.list
							.get(out);
					if (soi.getId() == this.objectId) {
						e = soi.getObjectName();
						if (this.escapeXml) {
							e = PageHelper.escapeXml(e);
						}
						break;
					}
				}
			}

			JspWriter arg4 = this.pageContext.getOut();
			arg4.print(e);
			return 0;
		} catch (Exception arg3) {
			throw new JspException(arg3.toString());
		}
	}

	public int doEndTag() {
		return 6;
	}

	public List getList() {
		return this.list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public long getObjectId() {
		return this.objectId;
	}

	public void setObjectId(long objectId) {
		this.objectId = objectId;
	}

	public boolean isEscapeXml() {
		return this.escapeXml;
	}

	public void setEscapeXml(boolean escapeXml) {
		this.escapeXml = escapeXml;
	}
}